<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>向社区医院转诊</title>
    <link rel="stylesheet" href="layui/css/layui.css" />
</head>

<body style="padding:20px">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>转诊治疗</legend>
    </fieldset>
    <form class="layui-form" action=" " lay-filter="formUpdate">
        <div class="layui-form-item">
            <label class="layui-form-label">病人编号</label>
            <div class="layui-input-block">
                <input type="text" name="patientId" readonly="readonly" lay-verify="title" autocomplete="off"
                    placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">病人姓名</label>
            <div class="layui-input-block">
                <input type="text" name="patientName" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="text" name="patientSex" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-block">
                <input type="text" name="patientAge" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">所属科室</label>
            <div class="layui-input-block">
                <input type="text" name="patientDepartment" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">主治医生</label>
            <div class="layui-input-block">
                <input type="text" name="patientDoctor" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">临床诊断</label>
            <div class="layui-input-block">
                <input type="text" name="patientDisease" lay-verify="title" autocomplete="off" placeholder="请输入内容"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入院日期</label>
            <div class="layui-input-inline">
                <input type="text" name="patientDate" id="date" lay-verify="date" placeholder="yyyy-MM-dd"
                    autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">其他信息</label>
            <div class="layui-input-block">
                <input type="text" name="patientInfo" lay-verify="title" autocomplete="off" placeholder="无"
                    class="layui-input">
            </div>
        </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">转诊医院</label>
            <div class="layui-input-block">

                <select name="upHospital" lay-verify="title">
                    <option value="">请选择社区医院</option>
                    <option value="大坪正街社区卫生服务站">大坪正街社区卫生服务站</option>
                    <option value="渝中区大坪街道社区卫生服务中心">渝中区大坪街道社区卫生服务中心</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">转诊原因</label>
            <div class="layui-input-block">

                <select name="upReason" lay-verify="title">
                    <option value="">请选择转诊理由</option>
                    <option value="各种危重症患者经救治后病情稳定进入疗养康复期">各种危重症患者经救治后病情稳定进入疗养康复期</option>
                    <option value="诊断明确，不需特殊治疗或需要长期治疗的慢性病患者">诊断明确，不需特殊治疗或需要长期治疗的慢性病患者</option>
                    <option value="手术愈合后需要长期康复的患者">手术愈合后需要长期康复的患者</option>
                    <option value="老年患者护理和照护">老年患者护理和照护</option>
                    <option value="心理障碍等精神疾病恢复期可以在社区进行恢复性治疗的患者">心理障碍等精神疾病恢复期可以在社区进行恢复性治疗的患者</option>
                    <option value="经治疗后病情稳定具有出院指征，家属要求继续康复治疗者">经治疗后病情稳定具有出院指征，家属要求继续康复治疗者</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="submitPat">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

    <script type="text/javascript" src="layui/layui.js"></script>
    <script>
        layui.use(['layer', 'laydate', 'form', 'jquery'], function () {
            var layer = layui.layer;
            var laydate = layui.laydate;
            var form = layui.form;
            var $ = layui.jquery

            //日期
            laydate.render({
                elem: '#date'
            });


            form.render();

            form.val('formUpdate', {
                patientId: parent.data.patientId,
                patientName: parent.data.patientName,
                patientSex: parent.data.patientSex,
                patientAge: parent.data.patientAge,
                patientDepartment: parent.data.patientDepartment,
                patientDoctor: parent.data.patientDoctor,
                patientDisease: parent.data.patientDisease,
                patientDate: parent.data.patientDate,
                patientInfo: parent.data.patientInfo,


            });



            form.on('submit(submitPat)', function (data) {

                $.ajax({
                    url: 'http://localhost:8080/record/addRec',
                    type: 'POST',
                    dataType: 'JSON',
                    data: data.field,
                    success: function (result) {


                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);

                        parent.table.reload("Patient");
                    }
                })



                return false;
            });
        });
    </script>
</body>

</html>